package com.ch.chatbot.domain.model.enums;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum GptModelEnum {

    TURBO(1, "gpt-3.5-turbo", "聊天模型，4,096 tokens"),
    TEXT_DAVINCI_003(2, "text-davinci-003", "质量更好的模型,强化学习，4,097 tokens"),
    TEXT_DAVINCI_002(3, "text-davinci-002", "质量更好的模型，监督微调，4,097 tokens"),
    CODE_DAVINCI_OO2(4, "code-davinci-002", "针对代码完成任务优化,8,001 tokens");

    private final int type;
    private final String model;
    private final String describe;

    public static String getModelByType(int type) {
        for (GptModelEnum gptModelEnum : GptModelEnum.values()) {
            if (type == gptModelEnum.getType()) {
                return gptModelEnum.getModel();
            }
        }
        return StrUtil.EMPTY;
    }
}
